package com.gs.core.service.impl;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gs.core.domain.Person;
import com.gs.core.repository.PersonRepository;
import com.gs.core.service.PersonService;
import com.gs.core.service.dao.ActionDAO;

@Service(value="personService")
public class PersonServiceImpl implements PersonService {

	@Autowired
	PersonRepository personRepository;
	
	@Autowired
	ActionDAO actionDAO;
		
	public List<Person> findAll() {
		return personRepository.findAll();
	}

	public Person findById(Long id) {
		return personRepository.findOne(id);
	}

	public Person saveOrUpdate(Person entity) {
		return personRepository.save(entity);
	}

	public void delete(Person entity) {
		personRepository.delete(entity);
	}

	public void deleteAll() {
		personRepository.deleteAll();
	}

}
